package router

import (
	"github.com/exam/initialize"
	"github.com/gin-gonic/gin"
)

type Routers struct {
	UserGroupRouter
	OrderGroupRouter
}

var AllRouter = new(Routers)

func InitRouter() *gin.Engine {
	engine := gin.Default()
	initialize.Viper()
	initialize.Nacos()
	initialize.Mysql()
	initialize.Redis()
	group := engine.Group("api")
	AllRouter.UserGroupRouter.UserRouter(group)
	AllRouter.OrderGroupRouter.OrderRouter(group)
	return engine
}
